package cn.vin.demo;

import com.alibaba.fastjson.JSONObject;

import java.util.Date;
import java.util.List;

public class RespDemo {
    private int code;
    private String message;
    private Data data;
    private boolean succ;

    public static void main(String[] args) {
        String s = "{\"code\":200,\"message\":\"ok\",\"data\":{\"records\":[{\"id\":\"1148056162587017217\",\"createBy\":null,\"createTime\":\"2019/07/08 10:28:14\",\"updateBy\":null,\"updateTime\":\"2019/07/24 00:31:36\",\"delFlag\":0,\"version\":9,\"userId\":\"1143317555739811841\",\"pigId\":3,\"orderId\":1153636051601412099,\"isAbleSale\":\"1\",\"price\":943.50,\"buyTime\":\"2019/07/23 21:17:34\",\"buyPrice\":898.57,\"endTime\":\"2019/07/24 21:17:34\",\"pigSalt\":\"aNQ0cZUUmgF43QEFidr+bdMF1nbg534LcF1sZozDx4rhLO8f59R/C9+ISwvPSeXO+anevXQPu06ZZsvw6ae/tSV+J4iEwscD7OoumMltv60=\",\"buyType\":\"userconfim\",\"fromUserId\":1151282101954408450,\"goodsName\":\"幸运兔\",\"contractDays\":1,\"incomeRatio\":5.00,\"pigCurrency\":943.50,\"userMobile\":\"13063695912\",\"purchaseUserPhone\":\"15876227430\",\"appointUserId\":null,\"auditStatus\":null,\"appointId\":null,\"userName\":null,\"profit\":47.18,\"djs\":null,\"remainingTime\":null,\"subRatio\":6.89620000,\"usdt\":136.8144}],\"total\":1,\"size\":10,\"current\":1,\"searchCount\":true,\"pages\":1},\"succ\":true}";
        RespDemo respDemo = JSONObject.parseObject(s, RespDemo.class);
        System.out.println(JSONObject.toJSONString(respDemo));
    }

    static class Data {
        private List<Record> records;
        private int total;
        private int size;
        private int current;
        private boolean searchCount;
        private int pages;

        public List<Record> getRecords() {
            return records;
        }

        public void setRecords(List<Record> records) {
            this.records = records;
        }

        public int getTotal() {
            return total;
        }

        public void setTotal(int total) {
            this.total = total;
        }

        public int getSize() {
            return size;
        }

        public void setSize(int size) {
            this.size = size;
        }

        public int getCurrent() {
            return current;
        }

        public void setCurrent(int current) {
            this.current = current;
        }

        public boolean isSearchCount() {
            return searchCount;
        }

        public void setSearchCount(boolean searchCount) {
            this.searchCount = searchCount;
        }

        public int getPages() {
            return pages;
        }

        public void setPages(int pages) {
            this.pages = pages;
        }
    }

    static class Record {
        private String id;
        private int delFlag;
        private int version;
        private String userId;
        private int pigId;
        private String orderId;
        private String isAbleSale;
        private double price;
        private Date buyTime;
        private double buyPrice;
        private Date endTime;
        private String pigSalt;
        private String buyType;
        private String fromUserId;
        private String goodsName;
        private int contractDays;
        private double incomeRatio;
        private double pigCurrency;
        private String userMobile;
        private String purchaseUserPhone;
        private double profit;
        private double subRatio;
        private double usdt;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public int getDelFlag() {
            return delFlag;
        }

        public void setDelFlag(int delFlag) {
            this.delFlag = delFlag;
        }

        public int getVersion() {
            return version;
        }

        public void setVersion(int version) {
            this.version = version;
        }

        public String getUserId() {
            return userId;
        }

        public void setUserId(String userId) {
            this.userId = userId;
        }

        public int getPigId() {
            return pigId;
        }

        public void setPigId(int pigId) {
            this.pigId = pigId;
        }

        public String getOrderId() {
            return orderId;
        }

        public void setOrderId(String orderId) {
            this.orderId = orderId;
        }

        public String getIsAbleSale() {
            return isAbleSale;
        }

        public void setIsAbleSale(String isAbleSale) {
            this.isAbleSale = isAbleSale;
        }

        public double getPrice() {
            return price;
        }

        public void setPrice(double price) {
            this.price = price;
        }

        public Date getBuyTime() {
            return buyTime;
        }

        public void setBuyTime(Date buyTime) {
            this.buyTime = buyTime;
        }

        public double getBuyPrice() {
            return buyPrice;
        }

        public void setBuyPrice(double buyPrice) {
            this.buyPrice = buyPrice;
        }

        public Date getEndTime() {
            return endTime;
        }

        public void setEndTime(Date endTime) {
            this.endTime = endTime;
        }

        public String getPigSalt() {
            return pigSalt;
        }

        public void setPigSalt(String pigSalt) {
            this.pigSalt = pigSalt;
        }

        public String getBuyType() {
            return buyType;
        }

        public void setBuyType(String buyType) {
            this.buyType = buyType;
        }

        public String getFromUserId() {
            return fromUserId;
        }

        public void setFromUserId(String fromUserId) {
            this.fromUserId = fromUserId;
        }

        public String getGoodsName() {
            return goodsName;
        }

        public void setGoodsName(String goodsName) {
            this.goodsName = goodsName;
        }

        public int getContractDays() {
            return contractDays;
        }

        public void setContractDays(int contractDays) {
            this.contractDays = contractDays;
        }

        public double getIncomeRatio() {
            return incomeRatio;
        }

        public void setIncomeRatio(double incomeRatio) {
            this.incomeRatio = incomeRatio;
        }

        public double getPigCurrency() {
            return pigCurrency;
        }

        public void setPigCurrency(double pigCurrency) {
            this.pigCurrency = pigCurrency;
        }

        public String getUserMobile() {
            return userMobile;
        }

        public void setUserMobile(String userMobile) {
            this.userMobile = userMobile;
        }

        public String getPurchaseUserPhone() {
            return purchaseUserPhone;
        }

        public void setPurchaseUserPhone(String purchaseUserPhone) {
            this.purchaseUserPhone = purchaseUserPhone;
        }

        public double getProfit() {
            return profit;
        }

        public void setProfit(double profit) {
            this.profit = profit;
        }

        public double getSubRatio() {
            return subRatio;
        }

        public void setSubRatio(double subRatio) {
            this.subRatio = subRatio;
        }

        public double getUsdt() {
            return usdt;
        }

        public void setUsdt(double usdt) {
            this.usdt = usdt;
        }
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Data getData() {
        return data;
    }

    public void setData(Data data) {
        this.data = data;
    }

    public boolean isSucc() {
        return succ;
    }

    public void setSucc(boolean succ) {
        this.succ = succ;
    }
}
